﻿using PLC.Application.RecipeVariables.Services;
using PLC.Interface.RecipeVariables;
using System.Collections.Generic;
using System.Threading.Tasks;
using YWM;
using YWM.Dto;

namespace PLC.Application.RecipeVariables
{
    public class RecipeVariableAppService : IRecipeVariableAppService
    {
        private readonly IRecipeVariableService _recipeVariableService = YApp.Resolve<IRecipeVariableService>();

        public async Task<IReadOnlyList<RecipeVariableDto>> GetList(long recipeId)
        {
            PagedResultDto<RecipeVariableDto> pagedResultDto = await _recipeVariableService.GetAll(new RecipeVariableResultRequestDto { RecipeId = recipeId });
            return pagedResultDto.Items;
        }
    }
}
